package com.tater.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.tater.service.HelloService;
import org.apache.dubbo.config.annotation.Service;

import java.util.concurrent.TimeUnit;

/**
 * @author Administrator
 */
@Service //dubbo包下的注解
public class HelloServiceImpl implements HelloService {
    @Override
    public String sayHello(String name) {
        return "hello service :"+name;
    }

    @Override
    public String methodA(String name) {
        int i = RandomUtil.randomInt(1, 100);
        try {
            TimeUnit.MILLISECONDS.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodA:"+name;
    }

    @Override
    public String methodB(String name) {
        int i = RandomUtil.randomInt(1, 100);
        try {
            TimeUnit.MILLISECONDS.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodB:"+name;

    }

    @Override
    public String methodC(String name) {
        int i = RandomUtil.randomInt(1, 100);
        try {
            TimeUnit.MILLISECONDS.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodC:"+name;

    }
}
